package com.yzj.Controller;

import com.yzj.Client.EmpClient;
import com.yzj.pojo.Emp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.Map;

@RestController
public class EmpController {
    @Autowired
    private EmpClient ec;

    @GetMapping("/myhello")
    private String hello(@RequestParam String name,@RequestHeader(value = "token") String token){
        System.out.println("consumer:"+name+new Date());
        System.out.println("myhello token:"+token);
        return ec.hello(name,token);
    }

    @GetMapping("/selectOne")
    private Emp selectOne( Emp emp){
        System.out.println("consumer:"+emp+new Date());
        return ec.selectOne(emp);
    }

    @GetMapping("/map")
    private Map<String,Object> map(@RequestParam Map<String,Object> map){
        return ec.map(map);
    }
}
